﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using System.ComponentModel;

namespace IronCow.Posh.Commands
{
    [Cmdlet(
        "Uncomplete", 
        "RtmTask", 
        DefaultParameterSetName = "InputObject",
        SupportsShouldProcess = true)]
    [Description("Uncompletes an RTM task.")]
    public class UncompleteRtmTaskCommand : RtmTaskCmdlet
    {
        public UncompleteRtmTaskCommand()
        {
        }

        protected override void ProcessRecord()
        {
            Task task = GetTaskRecord();
            if (ShouldProcess(string.Format("Task {0}: \"{1}\"", task.Id, task.Name)))
                task.Uncomplete();
        }
    }
}
